//
// IGraph.hpp<2> for nibbler in /home/titouan/Dropbox/Aksels-shared/philo
//
// Made by creach titouan
// Login   <titouan@epitech.net>
//
// Started on  Wed Mar 19 15:05:59 2014 creach titouan
// Last update Mon Mar 24 13:34:16 2014 Titouan Creach
//

#ifndef IGRAPH_HPP
#define IGRAPH_HPP

#include <iostream>
#include <dlfcn.h>
#include <stdexcept>
#include "Point.hpp"
#include <map>

class IGraph
{
public:

  enum Event
    {
      ESCAPE,
      RIGHT,
      LEFT,
      DOWN,
      UP,
      QUIT,
      NONE
    };

  enum Image
    {
      BODY,
      POMME,
      BORDURE,
      HEAD
    };

  virtual void loadImages(const std::map<IGraph::Image, std::string> &) = 0;
  virtual void openWindow() = 0;
  virtual void drawBlock(IGraph::Image, int, int) = 0;
  virtual void wait(unsigned int) const = 0;
  virtual ~IGraph() {}
  virtual IGraph::Event getNextEvent() = 0;
  virtual unsigned int getCurrentTime() const = 0;
  virtual void display() = 0;
  virtual void clearScreen(char r, char g, char b) = 0;
  virtual void loadFont(const std::string &fontPath) = 0;
  virtual void writeText(char r, char g, char b, const std::string &text, int x, int y) = 0;
  virtual Point getTextSize(const std::string &text) const = 0;
  virtual void pause() = 0;
};

typedef IGraph *(*f_constructor)(int, char**, int, int);
typedef void (*f_destruction)(IGraph *);


#endif
